package com.jiujiu.vi;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/vi")
public class ViController {
    @Autowired
    private ViService viService;

    @RequestMapping("/value")
    String calcValue(@RequestParam(value = "code") String code,
                     @RequestParam(value = "minG") Double minG,
                     @RequestParam(value = "maxG") Double maxG,
                     @RequestParam(value = "yearPre", required = false, defaultValue = "") Integer yearPre) {
        return viService.calcValue(code, minG, maxG, "</br>", yearPre);
    }


}
